//
//  UIView+Additions.m
//  yunqiphone
//
//  Created by Maple on 13-7-5.
//  Copyright (c) 2013年 ci123.com. All rights reserved.
//

#import "UIView+Additions.h"

@implementation UIView (Additions)

- (UIViewController *)viewController {
  UIResponder *next = [self nextResponder];
  do {
    if([next isKindOfClass:[UIViewController class]]) {
      return (UIViewController *)next;
    }
    
    next = [next nextResponder];
  }while (next != nil);
  
  return nil;
}
@end
